/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package py.com.peluq.model.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Diego_M
 */
@Entity
@Table(name = "pago_cheque", catalog = "peludb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PagoCheque.findAll", query = "SELECT p FROM PagoCheque p"),
    @NamedQuery(name = "PagoCheque.findByIdconciBanco", query = "SELECT p FROM PagoCheque p WHERE p.pagoChequePK.idconciBanco = :idconciBanco"),
    @NamedQuery(name = "PagoCheque.findByIdordenPago", query = "SELECT p FROM PagoCheque p WHERE p.pagoChequePK.idordenPago = :idordenPago"),
    @NamedQuery(name = "PagoCheque.findByNroCheque", query = "SELECT p FROM PagoCheque p WHERE p.nroCheque = :nroCheque"),
    @NamedQuery(name = "PagoCheque.findByNombreqRetira", query = "SELECT p FROM PagoCheque p WHERE p.nombreqRetira = :nombreqRetira"),
    @NamedQuery(name = "PagoCheque.findByApeqRetira", query = "SELECT p FROM PagoCheque p WHERE p.apeqRetira = :apeqRetira"),
    @NamedQuery(name = "PagoCheque.findByNroCi", query = "SELECT p FROM PagoCheque p WHERE p.nroCi = :nroCi"),
    @NamedQuery(name = "PagoCheque.findByFecha", query = "SELECT p FROM PagoCheque p WHERE p.fecha = :fecha")})
public class PagoCheque implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected PagoChequePK pagoChequePK;
    @Column(name = "nro_cheque")
    private Integer nroCheque;
    @Column(name = "nombreq_retira")
    private Integer nombreqRetira;
    @Column(name = "apeq_retira")
    private Integer apeqRetira;
    @Column(name = "nro_ci")
    private Integer nroCi;
    @Column(name = "fecha")
    @Temporal(TemporalType.DATE)
    private Date fecha;
    @JoinColumn(name = "idorden_pago", referencedColumnName = "idorden_pago", nullable = false, insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private OrdenPago ordenPago;
    @JoinColumn(name = "idconci_banco", referencedColumnName = "idconci_banco", nullable = false, insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private ConciBanco conciBanco;

    public PagoCheque() {
    }

    public PagoCheque(PagoChequePK pagoChequePK) {
        this.pagoChequePK = pagoChequePK;
    }

    public PagoCheque(int idconciBanco, int idordenPago) {
        this.pagoChequePK = new PagoChequePK(idconciBanco, idordenPago);
    }

    public PagoChequePK getPagoChequePK() {
        return pagoChequePK;
    }

    public void setPagoChequePK(PagoChequePK pagoChequePK) {
        this.pagoChequePK = pagoChequePK;
    }

    public Integer getNroCheque() {
        return nroCheque;
    }

    public void setNroCheque(Integer nroCheque) {
        this.nroCheque = nroCheque;
    }

    public Integer getNombreqRetira() {
        return nombreqRetira;
    }

    public void setNombreqRetira(Integer nombreqRetira) {
        this.nombreqRetira = nombreqRetira;
    }

    public Integer getApeqRetira() {
        return apeqRetira;
    }

    public void setApeqRetira(Integer apeqRetira) {
        this.apeqRetira = apeqRetira;
    }

    public Integer getNroCi() {
        return nroCi;
    }

    public void setNroCi(Integer nroCi) {
        this.nroCi = nroCi;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public OrdenPago getOrdenPago() {
        return ordenPago;
    }

    public void setOrdenPago(OrdenPago ordenPago) {
        this.ordenPago = ordenPago;
    }

    public ConciBanco getConciBanco() {
        return conciBanco;
    }

    public void setConciBanco(ConciBanco conciBanco) {
        this.conciBanco = conciBanco;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pagoChequePK != null ? pagoChequePK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PagoCheque)) {
            return false;
        }
        PagoCheque other = (PagoCheque) object;
        if ((this.pagoChequePK == null && other.pagoChequePK != null) || (this.pagoChequePK != null && !this.pagoChequePK.equals(other.pagoChequePK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.peluq.model.entity.PagoCheque[ pagoChequePK=" + pagoChequePK + " ]";
    }
    
}
